export default {
  // 根据ID查询设备管理详情
  'GET /v1/device/1': (req: any, res: any) => {
    setTimeout(() => {
      res.send({
        code: '0',
        data: {
          deviceId: 1,
          deviceTypeNo: 3001,
          mainImage: '1',
          firstTreeTypeId: 1,
          treeTypeId: 2,
          positionDetails: '1',
          deviceName: '设备名称1',
          brandNo: '1234',
          serialNumber: '1',
          model: '1',
          specs: '1',
          productionCompany: '1',
          productionTime: '2019-12-03T02:29:42.861Z',
          supplyCompany: '1',
          purchaseTime: '2019-12-03T02:29:42.861Z',
          serviceLife: '1',
          maintenanceCycle: '1',
          useUser: '1',
          departmentId: 139,
          useTime: '2019-12-03T02:29:42.861Z',
          unitNameId: 123,
          extendedField: '{"productName":"测试","loves":"1"}',
          remarks: '1',
          deviceState: null,
          stateCode: null,
          sort: null,
          deleteFalg: 1,
          createTime: '2019-12-03T02:29:42.861Z',
          createId: 1,
          updateTime: '2019-12-03T02:29:42.861Z',
          updateId: 1,
          groupId: null,
        },
      });
    }, 1000);
  },
  // 添加设备
  'POST /v1/device/add': (req: any, res: any) => {
    setTimeout(() => {
      res.send({
        code: '0',
        data: {},
      });
    }, 1000);
  },
  // 删除设备
  'DELETE /v1/device/delete': (req: any, res: any) => {
    setTimeout(() => {
      res.send({
        code: '0',
        data: {},
      });
    }, 1000);
  },
  // 设备导出
  'GET /v1/device/export': (req: any, res: any) => {
    setTimeout(() => {
      res.send({
        code: '0',
        data: {},
      });
    }, 1000);
  },
  // 设备管理分页查询
  'GET /v1/device/list': (req: any, res: any) => {
    setTimeout(() => {
      res.send({
        code: '0',
        data: {
          total: 100,
          rows: [
            {
              deviceId: 1,
              deviceName: '1',
              deviceTypeName: '电网',
              deviceTypeNo: 3001,
              treeTypeName: null,
              brandName: '停用',
              serialNumber: '1',
              deviceState: 1,
              stateCode: 1,
            },
            {
              deviceId: 2,
              deviceName: '1',
              deviceTypeName: '摄像头',
              deviceTypeNo: 21,
              treeTypeName: null,
              brandName: '必谈',
              serialNumber: '1',
              deviceState: 1,
              stateCode: 1,
            },
            {
              deviceId: 3,
              deviceName: '1',
              deviceTypeName: '电网',
              deviceTypeNo: 11,
              treeTypeName: null,
              brandName: '必谈',
              serialNumber: '1',
              deviceState: 1,
              stateCode: 1,
            },
            {
              deviceId: 4,
              deviceName: '1',
              deviceTypeName: '电网',
              deviceTypeNo: 5001,
              treeTypeName: null,
              brandName: '失败',
              serialNumber: '1',
              deviceState: 1,
              stateCode: 1,
            },
            {
              deviceId: 5,
              deviceName: '1',
              deviceTypeName: '电网',
              deviceTypeNo: 11,
              treeTypeName: null,
              brandName: '隐藏',
              serialNumber: '1',
              deviceState: 1,
              stateCode: 1,
            },
            {
              deviceId: 6,
              deviceName: '1',
              deviceTypeName: '摄像头',
              deviceTypeNo: 21,
              treeTypeName: null,
              brandName: '释放',
              serialNumber: '1',
              deviceState: 1,
              stateCode: 1,
            },
            {
              deviceId: 7,
              deviceName: '1',
              deviceTypeName: '摄像头',
              deviceTypeNo: 21,
              treeTypeName: null,
              brandName: '隐藏',
              serialNumber: '1',
              deviceState: 1,
              stateCode: 1,
            },
            {
              deviceId: 8,
              deviceName: '1',
              deviceTypeName: '摄像头',
              deviceTypeNo: 21,
              treeTypeName: null,
              brandName: '停用',
              serialNumber: '1',
              deviceState: 1,
              stateCode: 1,
            },
            {
              deviceId: 9,
              deviceName: '1',
              deviceTypeName: '电网',
              deviceTypeNo: 11,
              treeTypeName: null,
              brandName: '新增',
              serialNumber: '1',
              deviceState: 1,
              stateCode: 1,
            },
            {
              deviceId: 10,
              deviceName: '1',
              deviceTypeName: '摄像头',
              deviceTypeNo: 21,
              treeTypeName: null,
              brandName: '新增',
              serialNumber: '1',
              deviceState: 1,
              stateCode: 1,
            },
            {
              deviceId: 11,
              deviceName: '1',
              deviceTypeName: '电网',
              deviceTypeNo: 11,
              treeTypeName: null,
              brandName: '释放',
              serialNumber: '1',
              deviceState: 1,
              stateCode: 1,
            },
            {
              deviceId: 12,
              deviceName: '1',
              deviceTypeName: '摄像头',
              deviceTypeNo: 21,
              treeTypeName: null,
              brandName: '失败',
              serialNumber: '1',
              deviceState: 1,
              stateCode: 1,
            },
          ],
        },
      });
    }, 1000);
  },
  // 设备管理首页查询
  'GET /v1/device/selectAll': (req: any, res: any) => {
    setTimeout(() => {
      res.send({
        code: '0',
        data: {
          headVo: {
            deviceCount: 6,
            intactRate: '100%',
            deviceAlamCount: 0,
            deviceCountVos: null,
          },
          deviceCountVos: [
            {
              deviceTypeName: '环境信息',
              deviceCount: 1,
              deviceAlamToDay: 0,
              serialNumber: '100%',
              deviceTypeNo: 50,
            },
            {
              deviceTypeName: '运动康复',
              deviceCount: 1,
              deviceAlamToDay: 0,
              serialNumber: '100%',
              deviceTypeNo: 20,
            },
            {
              deviceTypeName: '生命体征',
              deviceCount: 1,
              deviceAlamToDay: 0,
              serialNumber: '100%',
              deviceTypeNo: 10,
            },
            {
              deviceTypeName: '戒毒医疗',
              deviceCount: 1,
              deviceAlamToDay: 0,
              serialNumber: '100%',
              deviceTypeNo: 40,
            },
            {
              deviceTypeName: '能耗监测',
              deviceCount: 1,
              deviceAlamToDay: 0,
              serialNumber: '100%',
              deviceTypeNo: 60,
            },
            {
              deviceTypeName: '物品信息',
              deviceCount: 1,
              deviceAlamToDay: 0,
              serialNumber: '100%',
              deviceTypeNo: 30,
            },
          ],
        },
      });
    }, 1000);
  },
  // 设备类型根据父类查询子类
  'GET /v1/device/deviceType/queryByFatherNo': (req: any, res: any) => {
    setTimeout(() => {
      res.send({
        code: '0',
        data: [
          {
            deviceTypeNo: 3001,
            deviceTypeName: '袜子',
            extendedField: JSON.stringify([
              {
                label: '货品名称',
                fieldName: 'productName',
                type: 'textfield',
                rules: '',
                defaultValue: 'apple Mac',
                readOnly: false,
              },
              {
                label: '爱好',
                fieldName: 'loves',
                type: 'singleSelect',
                rules: '',
                singleOption: [
                  {
                    itemValue: '1',
                    itemName: '看书',
                  },
                  {
                    itemValue: '2',
                    itemName: '羽毛球',
                  },
                ],
                defaultValue: '1',
              },
            ]),
          },
          {
            deviceTypeNo: 4001,
            deviceTypeName: '电击器',
            extendedField: JSON.stringify([
              {
                label: '货品名称',
                fieldName: 'productName',
                type: 'textfield',
                rules: '',
                defaultValue: 'apple Mac',
                readOnly: false,
              },
              {
                label: '爱好',
                fieldName: 'loves',
                type: 'singleSelect',
                rules: '',
                singleOption: [
                  {
                    itemValue: '1',
                    itemName: '看书',
                  },
                  {
                    itemValue: '2',
                    itemName: '羽毛球',
                  },
                ],
                defaultValue: '1',
              },
            ]),
          },
          {
            deviceTypeNo: 5001,
            deviceTypeName: '加湿器',
            extendedField: JSON.stringify([
              {
                label: '货品名称',
                fieldName: 'productName',
                type: 'textfield',
                rules: '',
                defaultValue: 'apple Mac',
                readOnly: false,
              },
              // {
              //   label: '爱好',
              //   fieldName: 'loves',
              //   type: 'singleSelect',
              //   rules: '',
              //   singleOption: [
              //     {
              //       itemValue: '1',
              //       itemName: '看书',
              //     },
              //     {
              //       itemValue: '2',
              //       itemName: '羽毛球',
              //     },
              //   ],
              //   defaultValue: '1',
              // },
            ]),
          },
          {
            deviceTypeNo: 6001,
            deviceTypeName: '电池',
            extendedField: JSON.stringify([
              {
                label: '货品名称',
                fieldName: 'productName',
                type: 'textfield',
                rules: '',
                defaultValue: 'apple Mac',
                readOnly: false,
              },
              {
                label: '爱好',
                fieldName: 'loves',
                type: 'singleSelect',
                rules: '',
                singleOption: [
                  {
                    itemValue: '1',
                    itemName: '看书',
                  },
                  {
                    itemValue: '2',
                    itemName: '羽毛球',
                  },
                ],
                defaultValue: '1',
              },
            ]),
          },
          {
            deviceTypeNo: 1001,
            deviceTypeName: '心电图',
            extendedField: JSON.stringify([
              {
                label: '货品名称',
                fieldName: 'productName',
                type: 'textfield',
                rules: '',
                defaultValue: 'apple Mac',
                readOnly: false,
              },
              {
                label: '爱好',
                fieldName: 'loves',
                type: 'singleSelect',
                rules: '',
                singleOption: [
                  {
                    itemValue: '1',
                    itemName: '看书',
                  },
                  {
                    itemValue: '2',
                    itemName: '羽毛球',
                  },
                ],
                defaultValue: '1',
              },
            ]),
          },
          {
            deviceTypeNo: 2001,
            deviceTypeName: '跑步机',
            extendedField: JSON.stringify([
              {
                label: '货品名称',
                fieldName: 'productName',
                type: 'textfield',
                rules: '',
                defaultValue: 'apple Mac',
                readOnly: false,
              },
              {
                label: '爱好',
                fieldName: 'loves',
                type: 'singleSelect',
                rules: '',
                singleOption: [
                  {
                    itemValue: '1',
                    itemName: '看书',
                  },
                  {
                    itemValue: '2',
                    itemName: '羽毛球',
                  },
                ],
                defaultValue: '1',
              },
            ]),
          },
        ],
      });
    }, 1000);
  },
  // 检测分析
  'GET /v1/device/monitorAnalyze/info': (req: any, res: any) => {
    setTimeout(() => {
      res.send({
        code: '0',
        data: {
          total: 15,
          error: 2,
          wellPercent: '86.67%',
          errorId: [1, 2],
          toType: [],
          toDays: [
            {
              name: '11-29',
              value: '0',
              percent: null,
            },
            {
              name: '11-28',
              value: '5',
              percent: null,
            },
            {
              name: '11-27',
              value: '1',
              percent: null,
            },
            {
              name: '11-26',
              value: '0',
              percent: null,
            },
            {
              name: '11-25',
              value: '0',
              percent: null,
            },
            {
              name: '11-24',
              value: '0',
              percent: null,
            },
            {
              name: '11-23',
              value: '0',
              percent: null,
            },
          ],
        },
      });
    }, 1000);
  },

  // 二维码导出
  'GET /v1/device/exportQrCode': (req: any, res: any) => {
    setTimeout(() => {
      res.send({
        code: '0',
        data: {},
      });
    }, 1000);
  },

  // 导入excel
  'POST /v1/introduce/importExcel/import': (req: any, res: any) => {
    setTimeout(() => {
      res.send({
        code: '0',
        data: {},
      });
    }, 1000);
  },

  // 下载excel
  'POST /v1/download/template/download': (req: any, res: any) => {
    setTimeout(() => {
      res.send({
        code: '0',
        data: {},
      });
    }, 1000);
  },
  // 故障点位详情
  'GET /v1/device/selectDeviceInfo': (req: any, res: any) => {
    setTimeout(() => {
      res.send({
        code: '0',
        data: {
          deviceId: '649979018887561216',
          deviceTypeParentNo: null,
          deviceTypeNo: '1301',
          mainImage: null,
          firstTreeTypeId: '8',
          treeTypeId: '3',
          positionDetails: '长沙湘江新区2',
          deviceName: '大功率空调10',
          brandNo: '0010',
          serialNumber: 'SN0030226',
          model: '56',
          specs: '0090',
          productionCompany: '深圳格力空调公司',
          productionTime: null,
          supplyCompany: '南方电商生产车间',
          purchaseTime: null,
          serviceLife: '90',
          maintenanceCycle: '800',
          useUser: '江津',
          departmentId: '666666632222222256',
          useTime: null,
          unitNameId: '222233332222222200',
          extendedField: null,
          remarks: '冬天适宜温度26摄氏度',
          deviceState: null,
          stateCode: null,
          sort: null,
          deleteFalg: '0',
          createTime: '2019-11-29 14:24:12',
          createId: '1',
          updateTime: '2019-11-29 16:58:03',
          updateId: '1',
          groupId: null,
        },
      });
    }, 1000);
  },
  //根据父类查子类
  'GET /v1/device/deviceType/queryByFatherNo': (req: any, res: any) => {
    setTimeout(() => {
      res.send({
        code: '0',
        data: [
          {
            deviceTypeNo: '1601',
            deviceTypeParentNo: '16',
            deviceTypeName: '基站',
            extendedField: null,
          },
          {
            deviceTypeNo: '1602',
            deviceTypeParentNo: '16',
            deviceTypeName: '综合报警器',
            extendedField: null,
          },
          {
            deviceTypeNo: '1603',
            deviceTypeParentNo: '16',
            deviceTypeName: '区域定位腕带',
            extendedField: null,
          },
        ],
      });
    }, 1000);
  },
};
